/***************************************************************************
 *   Copyright (C) 2008 by Jesse Crossen   *
 *   jesse.crossen@gmail.com   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
#ifndef TUNER_H
#define TUNER_H

#include <QWidget>
#include <QVBoxLayout>
#include <QGridLayout>
#include <QLabel>
#include <QComboBox>
#include <QSpinBox>
#include <QDoubleSpinBox>
#include <QSlider>

#include "music.h"
#include "listener.h"
#include "strobe.h"

/**
	@author Jesse Crossen <jesse.crossen@gmail.com>
*/
class Tuner : public QWidget
{
Q_OBJECT
public:
  Tuner(QWidget *parent = 0);

  ~Tuner();

protected:

  Music * music;
  Listener * listener;
  
  // the instrument currently being displayed
  int currentInstrument;
  // how many semitones it is transposed or capoed by
  int currentTranspose;
  // the current sensitivity level
  int currentSensitivity;
  
  // the grid that contains the strobe widgets
  QGridLayout * strobeGrid;
  // a list of strobe widgets
  QList<Strobe *> strobes;
  
public slots:
  // set the instrument being tuned
  void setInstrument(int index);
  // set how much to transpose that instrument
  void setTranspose(int semitones);
  // set the display sensitivity as a percentage between 0 and 100
  void setSensitivity(int percent);
  // set up the instrument panel
  void buildPanel();
};

#endif
